package com.atguigu;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @program: IDEAcode
 * @description:文件会被覆盖
 * @author: Mr.zjx
 * create: 2021-08-13-21-07
 **/
public class Test03 {
    public static void main(String[] args) throws IOException {
        writeByteArray();
    }
    private static void writeByteArray() throws IOException {
        FileOutputStream fos = new FileOutputStream("G:\\尚硅谷学习\\学习视频\\Java及数据库\\day19\\笔记\\mytxt\\1.txt");
        //写入字节数组
        byte[] b = "abcdef".getBytes();
        fos.write(b,2,3);

        fos.close();
    }
}
